package bean;

import java.sql.ResultSet;
import java.sql.SQLException;

import common.RowMapper;

public class AddressRowMapper implements RowMapper<Address> {

	@Override
	public Address mapper(ResultSet rs) throws SQLException {
		Address add=new Address();
		add.setAddressid(rs.getInt("addressid"));
		add.setUserid(rs.getInt("userid"));
		add.setConsignee(rs.getString("consignee"));
		add.setTel(rs.getString("tel"));
		add.setOptionalTel(rs.getString("optional_tel"));
		add.setProvince(rs.getString("province"));
		add.setCity(rs.getString("city"));
		add.setDistrict(rs.getString("district"));
		add.setStreet(rs.getString("street"));
		add.setAddress(rs.getString("address"));
		add.setPostcode(rs.getString("postcode"));
		add.setIfDefault(rs.getInt("ifdefault"));
		return add;
	}

}
